{
BUG_ON(!(act->pin & GNTPIN_hstr_mask));
act->pin -= GNTPIN_hstr_inc;
- /* Done implicitly when page tables are destroyed. */
- /* put_page(mfn_to_page(act->frame)); */
+ gnttab_release_put_page(mfn_to_page(act->frame));
}
}
else
{
BUG_ON(!(act->pin & GNTPIN_hstw_mask));
act->pin -= GNTPIN_hstw_inc;
- /* Done implicitly when page tables are destroyed. */
- /* put_page_and_type(mfn_to_page(act->frame)); */
+ gnttab_release_put_page_and_type(mfn_to_page(act->frame));
}
if ( (act->pin & (GNTPIN_devw_mask|GNTPIN_hstw_mask)) == 0 )
clear_bit(nr, addr);
}
+#define gnttab_release_put_page(page) put_page((page))
+#define gnttab_release_put_page_and_type(page) put_page_and_type((page))
+
#endif /* __ASM_GRANT_TABLE_H__ */
/* 16 GiB */
return 34 - PAGE_SHIFT;
}
+
+#if 0
+/*
+ * without put_page()/put_page_and_type() page might be leaked.
+ * with put_page()/put_page_and_type() freed page might be accessed.
+ */
+#define gnttab_release_put_page(page) put_page((page))
+#define gnttab_release_put_page_and_type(page) put_page_and_type((page))
+#else
+#define gnttab_release_put_page(page) do { } while (0)
+#define gnttab_release_put_page_and_type(page) do { } while (0)
+#endif
+
#endif /* __ASM_PPC_GRANT_TABLE_H__ */
clear_bit(nr, addr);
}
+#define gnttab_release_put_page(page) \
+ do { \
+ /* Done implicitly when page tables are destroyed. */ \
+ } while (0)
+
+#define gnttab_release_put_page_and_type(page) \
+ do { \
+ /* Done implicitly when page tables are destroyed. */ \
+ } while (0)
+
#endif /* __ASM_GRANT_TABLE_H__ */